package com.wbsxch.example.springsecurity.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class IndexController {

    @GetMapping("/index")
    public String index(){
        return "index";
    }

    /*@PostMapping("/api/login")
    public String login(@RequestBody UserBody userBody){
        UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(userBody.getUsername(), userBody.getPassword());
        Authentication authentication = authenticationProvider.authenticate(token);
        SecurityContextHolder.getContext().setAuthentication(authentication);
        return "登录成功";
    }*/

    @GetMapping("/login/success")
    public String success(){

        return "登录成功";
    }
}
